<template>
	<view class="my_courses">
		<scroll-view scroll-y="true" class="scroll-view-s">
			<view class="comlum_box">
				<view v-for="(item,index) in course" :key="index" class="course_Item_item">
					<image :src="item.image" mode="aspectFill" class="uimg"></image>
					<view class="right_comlumn">
						<view class="title">
							{{item.title}}
						</view>
						<view class="content">
							{{item.intro}}
						</view>
						<view class="row-box">
							<view v-for="(Skuitem,Skuindex) in item.label_list" :key="Skuindex" class="Skuitem">
								{{Skuitem.title}}
							</view>
						</view>
						<view class="bottom">
							<view class="left">
								<text class="red size1">￥</text>
								<text class="red size2">{{item.price}}</text>
								<text class="red size3">/节</text>
								<text class="td size3 gray">￥{{item.cost}}/节</text>
							</view>
							<view class="btn" @click="$ROUTELINK('courses_student?course=' + item.course)">
								课程学员
							</view>
						</view>
					</view>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	import {
		courseList
	} from '@/api/coach.js'
	export default {
		data() {
			return {
				course: []
			}
		},
		onLoad() {
			this.getcourseList()
		},
		methods: {
			getcourseList() {
				courseList().then(({
					data: res
				}) => {
					if (res.code == 1) {
						this.course = res.data
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background: #e9e9e9;
	}

	.my_courses {
		.scroll-view-s {
			height: 100vh;

			.comlum_box {
				display: flex;
				flex-direction: column;
				align-items: center;
				padding: 24rpx 20rpx 0;

				.course_Item_item {
					display: flex;
					flex-direction: row;
					align-items: center;
					width: 702rpx;
					height: 278rpx;
					background: #ffffff;
					border-radius: 16rpx;
					padding: 20rpx;
					margin-bottom: 16rpx;

					.uimg {
						width: 230rpx;
						height: 230rpx;
						background: rgba(0, 0, 0, 0.00);
						border-radius: 16rpx;
						margin-right: 20rpx;
					}

					.right_comlumn {
						display: flex;
						flex-direction: column;
						flex: 1;
						height: 100%;

						.title {
							font-size: 32rpx;
							font-family: PingFang SC, PingFang SC-Bold;
							font-weight: 700;
							text-align: left;
							color: #333333;
							margin-bottom: 4rpx;
						}

						.content {
							font-size: 24rpx;
							font-family: PingFang SC, PingFang SC-Medium;
							font-weight: 500;
							text-align: left;
							color: #666666;
							margin-bottom: 12rpx;
						}

						.row-box {
							display: flex;
							flex-direction: row;
							align-items: center;
							flex-wrap: wrap;
							flex: 1;

							.Skuitem {
								padding: 0 6rpx;
								height: 28rpx;
								background: #ededed;
								border-radius: 4rpx;
								margin-right: 6rpx;
								font-size: 20rpx;
								font-family: PingFang SC, PingFang SC-Medium;
								font-weight: 500;
								text-align: left;
								color: #666666;
								display: flex;
								align-items: center;
								justify-content: center;
							}
						}
					}
				}

				.bottom {
					display: flex;
					flex-direction: row;
					align-items: center;

					.left {
						display: flex;
						flex-direction: row;
						align-items: baseline;
						flex: 1;

						.red {
							color: #F37364;
						}

						.gray {
							color: #999999;
						}

						.fw1 {
							font-weight: 700;
						}

						.fw2 {
							font-weight: 500;
						}

						.size1 {
							font-size: 24rpx
						}

						.size2 {
							font-size: 32rpx
						}

						.size3 {
							font-size: 20rpx
						}

						.td {
							font-weight: 400;
							margin-left: 6rpx;
							text-decoration: line-through;
						}
					}

					.btn {
						transform: rotateZ(360deg);
						width: 152rpx;
						height: 64rpx;
						background: #73F0EA;
						border: 1rpx solid #73F0EA;
						border-radius: 16rpx;
						font-size: 28rpx;
						font-family: PingFang SC, PingFang SC-Bold;
						font-weight: 700;
						text-align: center;
						color: #ffffff;
						display: flex;
						align-items: center;
						justify-content: center;
					}
				}
			}
		}
	}
</style>